#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_components.dpatch by Mazen Neifer <mazen.neifer@supaero.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch fixes compilation of printer support units on architectures
## DP: which do not have libc unit (ie all except i386).

@DPATCH@
Index: components/printers/unix/udlgselectprinter.pp
===================================================================
--- lazarus~/components/printers/unix/udlgselectprinter.pp
+++ lazarus/components/printers/unix/udlgselectprinter.pp
@@ -62,18 +62,21 @@
     edPageSet: TCOMBOBOX;
     cbTasktime: TCOMBOBOX;
     edRange: TEDIT;
-    Groupbox1: TGROUPBOX;
+    PrinterStatePanel: TPanel;
+    PrinterComboPanel: TPanel;
+    PrinterLabelsPanel: TPanel;
+    PrinterGroupbox: TGroupbox;
     gbPages: TGROUPBOX;
     gbCopies: TGROUPBOX;
     ImgPrn: TIMAGE;
     imgCollate: TIMAGE;
-    Label1: TLABEL;
-    Label2: TLABEL;
-    Label3: TLABEL;
-    Label4: TLABEL;
+    PrinterNameLabel: TLabel;
+    PrinterStateLabel: TLabel;
+    PrinterLocationLabel: TLabel;
+    PrinterDescriptionLabel: TLabel;
     labComment: TLABEL;
     labCUPS: TLABEL;
-    Label5: TLABEL;
+    PrioLabel: TLabel;
     labCUPSServer: TLABEL;
     labTask: TLABEL;
     lanNumCopies: TLABEL;
@@ -84,7 +87,7 @@
     NbOpts: TNOTEBOOK;
     pgAdvance: TPAGE;
     pgCopies: TPAGE;
-    Panel1: TPANEL;
+    BtnPanel: TPanel;
     rbSelection: TRadioButton;
     rbRange: TRADIOBUTTON;
     rbCurrentPage: TRADIOBUTTON;
@@ -101,6 +104,7 @@
     procedure cbTasktimeCHANGE(Sender: TObject);
     procedure dlgSelectPrinterCREATE(Sender: TObject);
     procedure dlgSelectPrinterSHOW(Sender: TObject);
+    procedure PrinterStateLabelChangeBounds(Sender: TObject);
     procedure tkbPriorityCHANGE(Sender: TObject);
   private
     { private declarations }
@@ -122,18 +126,10 @@
 var
   dlgSelectPrinter: TdlgSelectPrinter;
 
-function GMTToLocalDateTime(aDate : TDateTime) : TDateTime;
-function LocalToGMTDateTime(aDate : TDateTime) : TDateTime;
-function LapseLocalToGMT : integer;
-
 implementation
 
 uses
-  {$IF DEFINED(darwin) OR DEFINED(freebsd)}
   miniCupsLibc,
-  {$ELSE}
-  Libc,
-  {$ENDIF}
   uDlgPropertiesPrinter;
 
 Type
@@ -166,8 +162,6 @@
   Result:=aDate+((TDateTime(LapseLocalToGMT)/3600)/24);
 end;
 
-{---------------------------------------------------}
-
 { TdlgSelectPrinter }
 
 constructor TdlgSelectPrinter.Create(aOwner : TComponent);
@@ -401,6 +395,11 @@
   RefreshInfos;
 end;
 
+procedure TdlgSelectPrinter.PrinterStateLabelChangeBounds(Sender: TObject);
+begin
+  labState.BorderSpacing.Top:=PrinterStateLabel.Top-labState.BorderSpacing.Around;
+end;
+
 procedure TdlgSelectPrinter.cbTasktimeCHANGE(Sender: TObject);
 begin
   if Sender=nil then ;
@@ -413,6 +412,7 @@
 begin
   if Sender=nil then ;
   fPropertiesSetting:=False;
+  NbOpts.PageIndex:=0;
 end;
 
 //Show corresponding image
